package cn.iocoder.yudao.module.pay.splitting.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 分账类型枚举
 * @author 山野羡民
 */
@Getter
@AllArgsConstructor
public enum SplittingTypeEnum implements EnumValuable {

    Payee(0, "收款方（收单金额）"),
    Participant(1, "参与方（分账金额）"),
    Platform(2, "平台方（佣金）"),
    ;

    private final Integer value;
    private final String name;

    public static SplittingTypeEnum valueOf(Integer status) {
        for (SplittingTypeEnum value : values()) {
            if (Objects.equals(value.getValue(), status)) {
                return value;
            }
        }
        return Payee;
    }

}
